package com.music.utils;

import com.music.response.SongResponse;
import com.music.core.model.Song;
import com.music.response.SongResponse;

/**
 * @author zhanghuiyong
 * @创建时间 2019年07月31日
 * @描述: 音乐模块工具类
 **/

public class MusicUtil {
    /**
     * 获取音乐查询返参   参数转换
     *
     * @param song
     * @return
     */
    public static SongResponse getSongResponse(Song song) {
        SongResponse songResponse = new SongResponse();
        //获取歌曲名称
        songResponse.setSongName(song.getName());
        //歌手名称
        songResponse.setArtistName(song.getArtists().get(0).getName());
        //专辑名称
        songResponse.setAlbumName(song.getAlbum().getName());
        //专辑图片地址
        songResponse.setAlbumPicUrl(song.getPicUrl());
        //音乐地址
        songResponse.setMusicLinkUrl(song.getMusicLink().getUrl());
        return songResponse;

    }
}
